#include<iostream>

using namespace std;
int n;
char c;
int main()
{
    cin >> n >> c;
    if (n == 0) 
    {
        cout << 0;
        return 0;
    }
    int cnt = 0;
    int i = 0;
    while (cnt <= n)
    {
        i++;
        cnt = (i + i * (i - 1) * 2 / 2) * 2 - 1;
    }
    i--;
    // zdl:: 现在开始打印这个图像
    for (int n = i; n > 0; n--)
    {
        // 打印空格
        for (int j = 0; j < i - n; j++)
        {
            cout << " ";
        }
        for (int m = 0; m < 1 + (n - 1) * 2; m++)
        {
            cout << c;
        }
        cout << endl;
    }
    for (int n = 1; n < i; n++)
    {
        for (int k = 0; k < i - n - 1; k++)
        {
            cout << " ";
        }
        for (int m = 0; m < 2 * n + 1; m++)
        {
            cout << c;
        }
        cout << endl;
    }
    cout << n - ((i + i * (i - 1) * 2 / 2) * 2 - 1) << endl;
    return 0;
}